#ifndef VTKDATAEXPORT_HPP
#define VTKDATAEXPORT_HPP

#include "vtkConstants.hpp"
#include "vtkFunctions_export.hpp"
#include "vtkMeshExport.hpp"
#include "vtkFieldExport.hpp"

namespace hms::vtk
{


template<typename SolverType>
void timestepToVtk(
	const fs::path& caseDir,
	const std::string& caseName,
	const SolverBase<SolverType>& solver,
	xml::XMLDocument* bindingDoc,
	const fs::path& bindingDocPath
){
	using MeshType = typename SolverBase<SolverType>::MeshType;

	fs::path vtkFilePath { caseDir / caseName };
	vtkFilePath += std::to_string( solver.time().nWritten() );

	/* set appropriate vtk file ending */
	replaceExtension<MeshType>( vtkFilePath );

	xml::XMLDocument doc;
	meshToVtk( &doc, solver.mesh() );

	writeDomainFields( &doc, solver );

	toFile( &doc, vtkFilePath );

	updateBindingFile(bindingDoc, bindingDocPath, solver.time(), vtkFilePath);
}


} // namespace hms::vtk


#endif